package com.fudan.adse.utils;

import java.util.Arrays;

/**
 * 字符串处理工具
 *
 * @author Jerry Zhang
 * create: 2022-11-24 16:15
 */
public class StringUtil {
    public static int[] spiltToIntArr(String text) {
        if (text == null || text.trim().isEmpty()) {
            return new int[]{};
        }
        return Arrays.stream(text.split(",")).mapToInt(Integer::parseInt).toArray();
    }

    public static String selfOrEmpty(String text) {
        return text == null ? "" : text;
    }
}
